<?php

class MY_Loader extends CI_Loader {
	
	public function __construct()
	{
		parent::__construct();
	}
	
	public function view_($view, $vars = array(), $return = FALSE)
	{
		$this->view('header_view', $vars, $return);
		if ($url = $this->error_500($view))
		{
			$vars['error_back_url'] = $url;
		}
		$this->view($view, $vars, $return);
		$this->view('footer_view', $vars, $return);
	}

	//如果是错误页面，获取错误页面前一个页面链接
	public function error_500($view)
	{
		if ('error_500_view' == $view)
		{
			return 'javascript:history.back()';
		}
		else
		{
			return false;
		}
	}

	
}